<template>
	<view>
		<home v-if="PageCur=='home'"></home>
		<game v-if="PageCur=='game'"></game>
		<music v-if="PageCur=='music'"></music>
		<about v-if="PageCur=='about'"></about>
		<view class="cu-bar tabbar bg-white shadow foot">
			<view class="action" @click="NavChange" data-cur="home">
				<view class='cuIcon-cu-image'>
					<image :src="'/static/image/icon/index' + '.png'"></image>
				</view>
				<view :class="PageCur=='home'?'text-green':'text-gray'">首页</view>
			</view>
			<view class="action" @click="NavChange" data-cur="music">
				<view class='cuIcon-cu-image'>
					<image :src="'/static/image/icon/guitar' + '.png'"></image>
				</view>
				<view :class="PageCur=='music'?'text-green':'text-gray'">音乐</view>
			</view>
			<!-- <view class="action" @click="NavChange" data-cur="game">
				<view class='cuIcon-cu-image'>
					<image :src="'/static/image/icon/game' + '.png'"></image>
				</view>
				<view :class="PageCur=='game'?'text-green':'text-gray'">游戏</view>
			</view> -->
			<view class="action" @click="NavChange" data-cur="about">
				<view class='cuIcon-cu-image'>
					<image :src="'/static/image/icon/geren' + '.png'"></image>
				</view>
				<view :class="PageCur=='about'?'text-green':'text-gray'">关于</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
		return {
				PageCur: 'home'
			}
		},
		methods: {
			NavChange: function(e) {
				this.PageCur = e.currentTarget.dataset.cur
				console.log(this.PageCur)
			}
		}
	}
</script>

<style>

</style>
